#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
import requests
import base64
 
url = 'http://api.tianapi.com/txapi/imglajifenlei/'

# encode = base64.b64encode(imgdata) #imgdata根据你的程序获取图片数据流后进行base64编码处理

body = {
        "key": "你的apikey",
        "img": ""}
headers = {'content-type': "application/x-www-form-urlencoded"}
 
response = requests.post(url, data = body, headers = headers)
 
# 返回信息
print response.text
